package com.ims.core.doc.service.impl;

import java.util.List;
import com.ims.common.utils.DateUtils;
import com.ims.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ims.core.doc.mapper.TInDeductionStatApplyMapper;
import com.ims.core.doc.domain.TInDeductionStatApply;
import com.ims.core.doc.service.ITInDeductionStatApplyService;

/**
 * 统计表申请记录Service业务层处理
 *
 * @author IMS
 * @date 2024-12-11
 */
@Service
public class TInDeductionStatApplyServiceImpl implements ITInDeductionStatApplyService
{
    @Autowired
    private TInDeductionStatApplyMapper tInDeductionStatApplyMapper;

    /**
     * 查询统计表申请记录
     *
     * @param id 统计表申请记录主键
     * @return 统计表申请记录
     */
    @Override
    public TInDeductionStatApply selectTInDeductionStatApplyById(Long id)
    {
        return tInDeductionStatApplyMapper.selectTInDeductionStatApplyById(id);
    }

    /**
     * 查询统计表申请记录
     *
     * @param applyId 统计表申请记录主ID
     * @return 统计表申请记录
     */
    @Override
    public TInDeductionStatApply selectTInDeductionStatApplyByApplyId(String applyId)
    {
        return tInDeductionStatApplyMapper.selectTInDeductionStatApplyByApplyId(applyId);
    }

    /**
     * 查询统计表申请记录列表
     *
     * @param tInDeductionStatApply 统计表申请记录
     * @return 统计表申请记录
     */
    @Override
    public List<TInDeductionStatApply> selectTInDeductionStatApplyList(TInDeductionStatApply tInDeductionStatApply)
    {
        return tInDeductionStatApplyMapper.selectTInDeductionStatApplyList(tInDeductionStatApply);
    }

    /**
     * 新增统计表申请记录
     *
     * @param tInDeductionStatApply 统计表申请记录
     * @return 结果
     */
    @Override
    public int insertTInDeductionStatApply(TInDeductionStatApply tInDeductionStatApply)
    {
        tInDeductionStatApply.setApplyId(IdUtils.simpleUUID());
        tInDeductionStatApply.setCreateTime(DateUtils.getNowDate());
        return tInDeductionStatApplyMapper.insertTInDeductionStatApply(tInDeductionStatApply);
    }

    /**
     * 修改统计表申请记录
     *
     * @param tInDeductionStatApply 统计表申请记录
     * @return 结果
     */
    @Override
    public int updateTInDeductionStatApply(TInDeductionStatApply tInDeductionStatApply)
    {
        tInDeductionStatApply.setUpdateTime(DateUtils.getNowDate());
        return tInDeductionStatApplyMapper.updateTInDeductionStatApply(tInDeductionStatApply);
    }

    /**
     * 批量删除统计表申请记录
     *
     * @param ids 需要删除的统计表申请记录主键
     * @return 结果
     */
    @Override
    public int deleteTInDeductionStatApplyByIds(Long[] ids)
    {
        return tInDeductionStatApplyMapper.deleteTInDeductionStatApplyByIds(ids);
    }

    /**
     * 删除统计表申请记录信息
     *
     * @param id 统计表申请记录主键
     * @return 结果
     */
    @Override
    public int deleteTInDeductionStatApplyById(Long id)
    {
        return tInDeductionStatApplyMapper.deleteTInDeductionStatApplyById(id);
    }
}
